import { pageSkip } from '@/utils/customTools'
import { message } from 'antd'
import store from 'store'

// --------------------------------------------------- 清除全部 localStorage ---------------------------------------------------
export const clearAll = async () => {
  store.clearAll()
  await message.success('已退出，请重新登录')
  pageSkip('/login')
}

// --------------------------------------------------- 用户相关 ---------------------------------------------------
export const getLoginInfo = () => store.get('loginInfo')
export const setLoginInfo = (user: any) => store.set('loginInfo', user)
export const clearLoginInfo = () => store.remove('loginInfo')
